package com.wing.common.enums;

import lombok.Getter;

/**
 * 认证方式枚举
 *
 * @author
 */
public enum AuthMethodEnum {

    USERNAME("username", "用户名"),
    MOBILE("mobile", "手机号"),
    OPENID("openId", "开放式认证系统唯一身份标识");

    @Getter
    private String value;

    @Getter
    private String label;

    AuthMethodEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }

    public static AuthMethodEnum getByValue(String value) {
        AuthMethodEnum authMethodEnum = null;
        for (AuthMethodEnum item : values()) {
            if (item.getValue().equals(value)) {
                authMethodEnum = item;
                continue;
            }
        }
        return authMethodEnum;
    }

}
